package com.lovo.ssc.controller;


import com.lovo.ssc.entity.Returngoods;
import com.lovo.ssc.service.IReturngoodsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 退货单 前端控制器
 * </p>
 *
 * @author lovo
 * @since 2022-07-11
 */
@RestController
@RequestMapping("/returngoods")
@Api(tags = "退货控制层002卢虹兵")
public class ReturngoodsController {

    @Autowired
    private IReturngoodsService returngoodsService;

    @PostMapping("saveReturnGoods")
    @ApiOperation(value = "添加退货订单")
    public boolean saveReturnGoods(Returngoods returngoods){
        return returngoodsService.save(returngoods);
    }

    @GetMapping("findAll")
    @ApiOperation(value = "查询全部退货单")
    public List<Returngoods> findAll(){
        return returngoodsService.list();
    }
}
